]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellDBus: Don't assume devices have a node
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Sep 2019 19:08:45 +0000 (21:08 +0200)
committerCarlos Garnacho <mrgarnacho@gmail.com>
Mon, 7 Oct 2019 21:24:13 +0000 (21:24 +0000)
Clutter.InputDevice.get_device_node() may return null. Handle that
case when building the 'AcceleratorActivated' vardict parameter.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1641

js/ui/shellDBus.js

index e750c207f9a103b19af68e9cfaf3351daa255455..fca0b6425537c8ecebc76a76336ef401b5569bda 100644 (file)
@@ -151,9 +151,13 @@ var GnomeShell = class {
         let connection = this._dbusImpl.get_connection();
         let info = this._dbusImpl.get_info();
         let params = { 'device-id': GLib.Variant.new('u', device.get_device_id()),
-                       'device-node': GLib.Variant.new('s', device.get_device_node()),
                        'timestamp': GLib.Variant.new('u', timestamp),
                        'action-mode': GLib.Variant.new('u', Main.actionMode) };
+
+        let deviceNode = device.get_device_node();
+        if (deviceNode)
+            params['device-node'] = GLib.Variant.new('s', deviceNode);
+
         connection.emit_signal(destination,
                                this._dbusImpl.get_object_path(),
                                info ? info.name : null,